package com.rabdsquirlz.wootoffreader;

import java.util.ArrayList;

import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;

public class RSSHandler extends DefaultHandler {
    /*
     * Constructor 
     */
    RSSHandler()
    {
    	nodes = new ArrayList<Pair<String,String>>();
    }
    
    public ArrayList<Pair<String,String>> nodes;
    
    public void startDocument() throws SAXException
    {
    }
    public void endDocument() throws SAXException
    {
    }
    public void startElement(String namespaceURI, String localName,String qName, 
                                             Attributes atts) throws SAXException
    {
        nodes.add(new Pair<String, String>(localName, ""));
    }
    
    public void endElement(String namespaceURI, String localName, String qName) 
                                                               throws SAXException
    {
    }
     
    public void characters(char ch[], int start, int length)
    {
    	String theString = new String(ch,start,length);
    	nodes.get(nodes.size()-1).b += theString;	       		
        		
    }

}
